<?php
/**
 * Conversations - A lightweight BB for Xaraya
 *
 * @package modules
 * @copyright (C) 2003-2006 The Digital Development Foundation.
 * @license GPL {@link http://www.gnu.org/licenses/gpl.html}
 * @link http://www.xaraya.com
 *
 * @subpackage conversations
 * @link http://xaraya.com/index.php/release/760.html
 * @author John Cox
*/
/**
 * Delete a tag
 * 
 * @package Xaraya eXtensible Management System
 * @copyright (C) 2005 by the Xaraya Development Team.
 * @license GPL {@link http://www.gnu.org/licenses/gpl.html}
 * @link http://www.xaraya.org
*/
/**
 * delete a tag
 * @param $args['postid'] integer
 * @param $args['tagid'] integer
 * @returns bool
 * @return true on success, false on failure
 */
function conversations_userapi_deleteposts($args)
{
    extract($args);
    // Get datbase setup
    if (xarModAPIFunc('conversations', 'user', 'deletelook', array('postid' => $postid))) return;

    $dbconn =& xarDBGetConn();
    $xartable =& xarDBGetTables();
    $table = $xartable['cposts'];

    $query = "DELETE FROM $table WHERE xar_postid = ?";
    $result =& $dbconn->Execute($query, array($postid));
    if (!$result) return;

    // Let any hooks know that we have deleted a forum
    $args['module'] = 'conversations';
    $args['itemtype'] = 1;
    $args['itemid'] = $postid;
    xarModCallHooks('item', 'delete', $postid, $args);
    return true;
}
?>